package com.loan.job.service;

import com.loan.system.service.ApplyService;
import com.xxl.job.core.context.XxlJobHelper;
import com.xxl.job.core.handler.annotation.XxlJob;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author shiguang
 * @date 2022年09月24日 10:11
 */
@Slf4j
@Service
public class SendMsgService {

    @Autowired
    private ApplyService applyService;

    /**
     * 到期前一天短信
     * @throws Exception
     */
    @XxlJob("sendPaymentBeforeDay")
    public void SendPaymentBeforeDay() throws Exception {
        XxlJobHelper.log("run SendPaymentBeforeDay.");
        applyService.sendPaymentBeforeDay();
    }

    /**
     * 到期当天短信
     * @throws Exception
     */
    @XxlJob("sendPaymentDay")
    public void SendPaymentDay() throws Exception {
        XxlJobHelper.log("run SendPaymentDay.");
        applyService.sendPaymentDay();
    }

    /**
     * 逾期短信
     * @throws Exception
     */
    @XxlJob("sendPaymentOverDay")
    public void sendPaymentOverDay() throws Exception {
        XxlJobHelper.log("run SendPaymentBeforeDay.");
        applyService.sendPaymentOverDay();
    }
}
